Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Added Tizen Mobile Blazor Bindings #285

Merged
merged 6 commits into from
Jan 20, 2021
Merged

Conversation

rookiejava
Copy link
Contributor

@rookiejava rookiejava commented Jan 6, 2021

This PR adds the Tizen implementation of mobile blazor binding.

mobile-blazor-hybridapp

(thanks @myroot ❤️ for debugging and testing together.)

Fixes #306

@rookiejava rookiejava force-pushed the add-tizen branch 2 times, most recently from cd37bd2 to d58e7b1 Compare January 14, 2021 01:27
@rookiejava rookiejava force-pushed the add-tizen branch 2 times, most recently from 0f44bed to 9280224 Compare January 17, 2021 23:00
@Eilon
Copy link
Member

Eilon commented Jan 19, 2021

Hi, I pushed some small updates to the PR for code style and to try and enable code signing for the Tizen WebView DLL.

Unfortunately I can't run the Tizen emulator right now because I can't install Intel HAXM on this machine, but I will try to do it on another machine to test it out.

In the meantime...

감사합니다. 혹시 서울 에 만날가여요.

@Eilon
Copy link
Member

Eilon commented Jan 19, 2021

OK, this looks like it builds on CI now!

Some other stuff to do:

  • Investigate build.props/targets for Tizen NUPKG so package up static asset resources. Right now it looks like the Tizen samples have all the static assets copied into them, which is not ideal. For other platforms there is a set of props/targets that does the appropriate copying to make sure the assets are included.
  • In the HybridApp.Tizen sample app, the Main.cs file has an [ExportRenderer(...)] attribute. Is this necessary?
  • I need to set up the Tizen emulator on another machine to test

@Eilon
Copy link
Member

Eilon commented Jan 20, 2021

I got the Tizen emulator running on my 3rd laptop 😄 And Mobile Blazor Bindings is working great!

Now I will look at the other items I mentioned.

@rookiejava
Copy link
Contributor Author

  • Investigate build.props/targets for Tizen NUPKG so package up static asset resources. Right now it looks like the Tizen samples have all the static assets copied into them, which is not ideal. For other platforms there is a set of props/targets that does the appropriate copying to make sure the assets are included.

You are right. Currently, unlike to other platforms, tizen samples copied static assets manually. To resolve this issue we will be discussing with the tizen sdk team.

  • In the HybridApp.Tizen sample app, the Main.cs file has an [ExportRenderer(...)] attribute. Is this necessary?

Yes, this is currently required due to the limitations of current Xamarin.Forms Tizen backend implementation.
In order to optimize the process of scanning assembles and registering handlers during Forms.Init(), we intentionally excluded assembly starting with System ("System."), Microsoft("Microsoft."), etc as shown below.

https://github.com/xamarin/Xamarin.Forms/blob/b370f34d12726ddbb7a1516a9d1bfc7fd38f3894/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs#L231

Unfortunately, in this case, the assembly that provides the WebViewExtendedRender is starting with Microsoft, so the App must explicitly declare the ExportRender. I'll submit a patch to Xamarin.Forms soon to correct this issue.

감사합니다. 혹시 서울 에 만날가여요.

Awesome! It's perfect Korean. Have you ever visit Korea before? and have any plan to visit Korea?
I look forward to seeing you in Korea when Covid-19 gets better.

@Eilon
Copy link
Member

Eilon commented Jan 20, 2021

@rookiejava thank you for the info! I think the code is almost ready to merge, I'll just take another look to be sure.

I'll write up some docs on Tizen for the MBB docs for these special cases and tag you for review in case you want to check it out.

  1. Re: Tizen static assets. Got it. I would love to see what you come up with for this. Every platform already has its own unique build targets/props, and they are not easy to write. Let me know if you need any help with it (I'm not an expert, though).
  2. Re: Assembly load. Ah I see, so Tizen is a bit special here. BTW the code in Xamarin.Forms might have a small bug in it because it's not using StringComparison.Ordinal, so if it's running in a culture such as Turkish where comparing the letter "i" is different from English, it could produce incorrect comparisons. This isn't security code, and it's unlikely to be much of a problem, but it's best to pass in the correct comparer.

아내는 한국 사람 이에요. 그래서 나는 한국에 와서요. My Korean is not too great but I try to practice it! 😂

@Eilon Eilon mentioned this pull request Jan 20, 2021
3 tasks
@Eilon
Copy link
Member

Eilon commented Jan 20, 2021

I logged two issues to track Tizen work:

@Eilon Eilon merged commit ced4992 into dotnet:master Jan 20, 2021
@Eilon
Copy link
Member

Eilon commented Jan 20, 2021

Initial docs are here: MicrosoftDocs/mobile-blazor-bindings@f343d9d#diff-77a5ba71c21cbcf5bdbf37c4d8d493e38c56332157920ebbafaf9458606d34f0

They will be live on the docs site when Preview 6 ships to the public.

@Eilon
Copy link
Member

Eilon commented Jan 20, 2021

A huge huge thank you to @rookiejava and @myroot for this great work! The build has completed and there are now NuGet packages on the public nightly feed: https://docs.microsoft.com/mobile-blazor-bindings/contribute/nightly-builds

@rookiejava
Copy link
Contributor Author

감사합니다! ❤️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initial Tizen work for native and hybrid apps
3 participants